// Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas Neshkov  Date: 22/03/2011 12:30:11 p.m.
// Home Page: http://members.fortunecity.com/neshkov/dj.html  http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   ReportDialog.java

package com.luxsoft.sw3.impap.services;

import com.luxsoft.siipap.swing.controls.SXAbstractDialog;
import java.awt.BorderLayout;
import javax.swing.JComponent;
import javax.swing.JPanel;
import net.sf.jasperreports.view.JRViewer;

public class ReportDialog extends SXAbstractDialog
{

    public ReportDialog(JRViewer view, String title)
    {
        super(title);
        okButton = false;
        reportView = view;
    }

    public ReportDialog(JRViewer view, String title, boolean okButton)
    {
        super(title);
        this.okButton = false;
        reportView = view;
        this.okButton = okButton;
    }

    protected JComponent buildContent()
    {
        if(okButton)
        {
            JPanel content = new JPanel(new BorderLayout());
            content.add(reportView, "Center");
            content.add(buildButtonBarWithOKCancel(), "South");
            return content;
        } else
        {
            return reportView;
        }
    }

    protected void setResizable()
    {
        setResizable(true);
    }

    private final JRViewer reportView;
    private boolean okButton;
}
